package com.th.supcom.pds.impl.manager.impl;

import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import net.carefx.fc.framework.db.manager.GetSequenceHelper;

import org.apache.ibatis.session.RowBounds;

import com.th.supcom.pds.domain.pojo.Office;
import com.th.supcom.pds.domain.pojo.PdsPhamDocuDetail;
import com.th.supcom.pds.domain.pojo.PdsPrescDetail;
import com.th.supcom.pds.domain.pojo.PdsPrescDetailCombine;
import com.th.supcom.pds.domain.pojo.PdsPrescDetailPham;
import com.th.supcom.pds.domain.vo.PdsPrescDetailAndPrescVo;
import com.th.supcom.pds.domain.vo.PdsPrescDetailVO;
import com.th.supcom.pds.domain.vo.PdsPrescParametersVO;
import com.th.supcom.pds.impl.dao.PdsPrescDetailMapper;
import com.th.supcom.pds.impl.manager.PdsPrescDetailManager;

/**
 * PdsPrescDetail 管理接口实现.
 * 
 * 处方明细.
 */
public class PdsPrescDetailManagerImpl implements PdsPrescDetailManager
{

    public static final String TAB_PDS_PRESC_DETAIL = "PDS_PRESC_DETAIL";

    private PdsPrescDetailMapper m_pdsPrescDetailMapper;

    /** 序列生成器. */
    private GetSequenceHelper m_getSequenceHelper;

    /**
     * 默认的构造函数.
     */
    public PdsPrescDetailManagerImpl ()
    {

    }

    /**
     * 获取PdsPrescDetailMapper.
     * 
     * @return PdsPrescDetailMapper.
     */
    public PdsPrescDetailMapper getPdsPrescDetailMapper ()
    {
        return m_pdsPrescDetailMapper;
    }

    /**
     * 注入PdsPrescDetailMapper.
     * 
     * @param pdsPrescDetailMapper set pdsPrescDetailMapper.
     */
    public void setPdsPrescDetailMapper (PdsPrescDetailMapper pdsPrescDetailMapper)
    {
        m_pdsPrescDetailMapper = pdsPrescDetailMapper;
    }

    /**
     * 获取序列.
     * 
     * @return GetSequenceHelper
     */
    public GetSequenceHelper getGetSequenceHelper ()
    {
        return m_getSequenceHelper;
    }

    /**
     * 注入序列.
     * 
     * @param getSequenceHelper getSequenceHelper.
     */
    public void setGetSequenceHelper (GetSequenceHelper getSequenceHelper)
    {
        m_getSequenceHelper = getSequenceHelper;
    }

    @Override
    public List <PdsPrescDetailAndPrescVo> getPrescDetailByPrescNo (PdsPrescDetailAndPrescVo pdsPrescDetailAndPrescVo)
    {
        return m_pdsPrescDetailMapper.getPrescDetailByPrescNo (pdsPrescDetailAndPrescVo);
    }

    @Override
    public PdsPrescDetail getPdsPrescDetailByID (String id)
    {
        return m_pdsPrescDetailMapper.getPdsPrescDetailByID (id);
    }

    @Override
    public Long getPdsPrescDetailSeq ()
    {
        return m_getSequenceHelper.getNextSequenceId (TAB_PDS_PRESC_DETAIL);
    }

    @Override
    public List <PdsPrescDetail> findPdsPrescDetailListByExample (PdsPrescDetail pdsPrescDetail)
    {
        return m_pdsPrescDetailMapper.findPdsPrescDetailListByExample (pdsPrescDetail);
    }

    @Override
    public List <PdsPrescDetailVO> queryPrescDetail (PdsPrescParametersVO pdsPrescParametersVO)
    {
        return m_pdsPrescDetailMapper.queryPrescDetailByPrescNo (pdsPrescParametersVO);
    }

    @Override
    public int findPdsPrescDetailCountByExample (PdsPrescDetail pdsPrescDetail)
    {
        return m_pdsPrescDetailMapper.findPdsPrescDetailCountByExample (pdsPrescDetail);
    }

    @Override
    public List <PdsPrescDetail> findPdsPrescDetailListByMap (Map <String, Object> params)
    {
        return m_pdsPrescDetailMapper.findPdsPrescDetailListByMap (params);
    }

    @Override
    public List <PdsPrescDetail> findPdsPrescDetailListWithPageByMap (Map <String, Object> params, Integer offset, Integer limit)
    {
        return m_pdsPrescDetailMapper.findPdsPrescDetailListWithPageByMap (new RowBounds (offset, limit), params);
    }

    @Override
    public Integer findPdsPrescDetailCountByMap (Map <String, Object> params)
    {
        return m_pdsPrescDetailMapper.findPdsPrescDetailCountByMap (params);
    }

    @Override
    public int modifyPdsPrescDetail (PdsPrescDetail pdsPrescDetail)
    {
        return m_pdsPrescDetailMapper.modifyPdsPrescDetail (pdsPrescDetail);
    }

    @Override
    public int removePdsPrescDetailByID (Long id)
    {
        return m_pdsPrescDetailMapper.removePdsPrescDetailByID (id);
    }

    @Override
    public int removePdsPrescDetailByMap (Map <String, Object> params)
    {
        return m_pdsPrescDetailMapper.removePdsPrescDetailByMap (params);
    }

    @Override
    public void addPdsPrescDetail (PdsPrescDetail pdsPrescDetail)
    {
        m_pdsPrescDetailMapper.addPdsPrescDetail (pdsPrescDetail);
    }

    @Override
    public int findCombinePdsPrescDetailCountByExample (PdsPrescDetailCombine pdsPrescDetailCombine)
    {
        return m_pdsPrescDetailMapper.findCombinePdsPrescDetailCountByExample (pdsPrescDetailCombine);
    }

    @Override
    public List <PdsPrescDetailCombine> findCombinePdsPrescDetailListByMap (Map <String, Object> params)
    {
        return m_pdsPrescDetailMapper.findCombinePdsPrescDetailListByMap (params);
    }

    @Override
    public List <PdsPrescDetailCombine> findCombinePdsPrescDetailListWithPageByMap (Map <String, Object> params, Integer offset, Integer limit)
    {
        return m_pdsPrescDetailMapper.findCombinePdsPrescDetailListWithPageByMap (new RowBounds (offset, limit), params);
    }

    @Override
    public Integer findCombinePdsPrescDetailCountByMap (Map <String, Object> params)
    {
        return m_pdsPrescDetailMapper.findCombinePdsPrescDetailCountByMap (params);
    }

    @Override
    public List <PdsPrescDetailCombine> findCombinePdsPrescDetailListByRcptNo (Map <String, Object> map)
    {
        return m_pdsPrescDetailMapper.findCombinePdsPrescDetailListByRcptNo (map);
    }

    @Override
    public int modifyPdsPrescDetailStatusByExample (PdsPrescDetail pdsPrescDetail)
    {
        return m_pdsPrescDetailMapper.modifyPdsPrescDetailStatusByExample (pdsPrescDetail);
    }

    @Override
    public List <PdsPrescDetailCombine> findCombinePdsPrescDetailListByExample (PdsPrescDetailCombine pdsPrescDetailCombine)
    {
        return m_pdsPrescDetailMapper.findCombinePdsPrescDetailListByExample (pdsPrescDetailCombine);
    }

    public Integer findPdsSortDrugCountByMap (Map <String, Object> params)
    {

        return m_pdsPrescDetailMapper.findPdsSortDrugCountByMap (params);

    }

    @Override
    public List <PdsPrescDetailCombine> findCombinePdsPrescDetailListByList (List <PdsPrescDetailCombine> pdsPrescDetailCombines)
    {
        return m_pdsPrescDetailMapper.findCombinePdsPrescDetailListByList (pdsPrescDetailCombines);
    }

    @Override
    public int modifyPdsPrescDetailList (List <PdsPrescDetailCombine> pdsPrescDetailCombines)
    {
        return m_pdsPrescDetailMapper.modifyPdsPrescDetailList (pdsPrescDetailCombines);
    }

    @Override
    public int modiPresDetaForReturnDrug (List <PdsPrescDetail> pdsPrescDetail)
    {
        return m_pdsPrescDetailMapper.modiPresDetaForReturnDrug (pdsPrescDetail);
    }

    @Override
    public List <PdsPrescDetailAndPrescVo> findPrescDetailByPrescNo (PdsPrescDetailAndPrescVo pdsPrescDetailAndPrescVo)
    {
        return m_pdsPrescDetailMapper.findPrescDetailByPrescNo (pdsPrescDetailAndPrescVo);

    }

    @Override
    public List <PdsPrescDetailCombine> findPhamBatchByExample (PdsPrescDetailCombine pdsPrescDetailCombine)
    {
        return m_pdsPrescDetailMapper.findPhamBatchByExample (pdsPrescDetailCombine);
    }

    @Override
    public List <PdsPrescDetailAndPrescVo> findPrescDetailByPrescAndRcpt (Map <String, Object> params)
    {
        return m_pdsPrescDetailMapper.findPrescDetailByPrescAndRcpt (params);
    }

    @Override
    public List <PdsPrescDetailAndPrescVo> getPrescDetailForReturn (PdsPrescDetailAndPrescVo pdsPrescDetailAndPrescVo)
    {
        return m_pdsPrescDetailMapper.getPrescDetailForReturn (pdsPrescDetailAndPrescVo);
    }

    @Override
    public List <PdsPrescDetailAndPrescVo> getPrescDetailForRefund (PdsPrescDetailAndPrescVo pdsPrescDetailAndPrescVo)
    {
        return m_pdsPrescDetailMapper.getPrescDetailForRefund (pdsPrescDetailAndPrescVo);
    }

    @Override
    public List <PdsPrescDetailAndPrescVo> findPrescDetailForRecipefee (PdsPrescDetailAndPrescVo pdsPrescDetailAndPrescVo)
    {

        return m_pdsPrescDetailMapper.findPrescDetailForRecipefee (pdsPrescDetailAndPrescVo);

    }

    @Override
    public Integer findDrugStockByExample (PdsPrescDetailCombine pdsPrescDetailCombine)
    {

        return m_pdsPrescDetailMapper.findDrugStockByExample (pdsPrescDetailCombine);

    }

    @Override
    public String findDrugBatchFlagByCode (PdsPrescDetailCombine pdsPrescDetailCombine)
    {

        return m_pdsPrescDetailMapper.findDrugBatchFlagByCode (pdsPrescDetailCombine);

    }

    @Override
    public List <Office> findExecutiveOffice (PdsPrescDetailCombine pdsPrescDetailCombine)
    {

        return m_pdsPrescDetailMapper.findExecutiveOffice (pdsPrescDetailCombine);

    }

    @Override
    public List <PdsPhamDocuDetail> findPhamDocuDetailByList (List <PdsPrescDetailCombine> pdsPrescDetailCombines)
    {
        return m_pdsPrescDetailMapper.findPhamDocuDetailByList (pdsPrescDetailCombines);
    }

    @Override
    public int modifyPdsPrescDetailExNoList (List <PdsPrescDetailCombine> pdsPrescDetailCombines)
    {
        return m_pdsPrescDetailMapper.modifyPdsPrescDetailExNoList (pdsPrescDetailCombines);
    }

    @Override
    public List <PdsPrescDetailPham> findPrescDetailPhamByList (List <PdsPrescDetailCombine> pdsPrescDetailCombines)
    {
        return m_pdsPrescDetailMapper.findPrescDetailPhamByList (pdsPrescDetailCombines);
    }

    @Override
    public int modifyPdsPrescDetailWindowByList (List <PdsPrescDetailCombine> pdsPrescDetailCombines)
    {
        return m_pdsPrescDetailMapper.modifyPdsPrescDetailWindowByList (pdsPrescDetailCombines);
    }

    @Override
    public int modifyChargeIndicator (List <PdsPrescDetail> pdsPrescDetail)
    {
        return m_pdsPrescDetailMapper.modifyChargeIndicator (pdsPrescDetail);

    }

    @Override
    public int modifyPdsPrescDetailByExample (PdsPrescDetail pdsPrescDetail)
    {

        return m_pdsPrescDetailMapper.modifyPdsPrescDetailByExample (pdsPrescDetail);

    }

    @Override
    public List <Office> findExecutiveOffice ()
    {
        return m_pdsPrescDetailMapper.findAllExecutiveOffice ();

    }

    @Override
    public List <String> findPrescNoByPatientId (String patientId, Date enterTime)
    {
        Map <String, Object> params = new HashMap <String, Object> ();
        params.put ("patientId", patientId);
        params.put ("enterTime", enterTime);
        return m_pdsPrescDetailMapper.findPrescNoByPatientId (params);

    }

    @Override
    public List <PdsPrescDetailAndPrescVo> findPrescDetailForPrint (PdsPrescDetailAndPrescVo pdsPrescDetailAndPrescVo)
    {
        return m_pdsPrescDetailMapper.findPrescDetailForPrint (pdsPrescDetailAndPrescVo);
    }
}
